Optimal. Leaf size=147 \[ -\frac {2 a^{5/2} A \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {4 \sqrt {2} a^{5/2} (A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {2 a^2 (A-2 i B) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {2 i a B (a+i a \tan (c+d x))^{3/2}}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.35, antiderivative size = 147, normalized size of antiderivative = 1.00, number of steps
used = 8, number of rules used = 7, integrand size = 34, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.206, Rules used = {3675, 3681,
3561, 212, 3680, 65, 214} \begin {gather*} \frac {4 \sqrt {2} a^{5/2} (A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {2 a^{5/2} A \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}-\frac {2 a^2 (A-2 i B) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {2 i a B (a+i a \tan (c+d x))^{3/2}}{3 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 212
Rule 214
Rule 3561
Rule 3675
Rule 3680
Rule 3681
Rubi steps
\begin {align*} \int \cot (c+d x) (a+i a \tan (c+d x))^{5/2} (A+B \tan (c+d x)) \, dx &=\frac {2 i a B (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {2}{3} \int \cot (c+d x) (a+i a \tan (c+d x))^{3/2} \left (\frac {3 a A}{2}+\frac {3}{2} a (i A+2 B) \tan (c+d x)\right ) \, dx\\ &=-\frac {2 a^2 (A-2 i B) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {2 i a B (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {4}{3} \int \cot (c+d x) \sqrt {a+i a \tan (c+d x)} \left (\frac {3 a^2 A}{4}+\frac {3}{4} a^2 (3 i A+4 B) \tan (c+d x)\right ) \, dx\\ &=-\frac {2 a^2 (A-2 i B) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {2 i a B (a+i a \tan (c+d x))^{3/2}}{3 d}+(a A) \int \cot (c+d x) (a-i a \tan (c+d x)) \sqrt {a+i a \tan (c+d x)} \, dx+\left (4 a^2 (i A+B)\right ) \int \sqrt {a+i a \tan (c+d x)} \, dx\\ &=-\frac {2 a^2 (A-2 i B) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {2 i a B (a+i a \tan (c+d x))^{3/2}}{3 d}+\frac {\left (a^3 A\right ) \text {Subst}\left (\int \frac {1}{x \sqrt {a+i a x}} \, dx,x,\tan (c+d x)\right )}{d}+\frac {\left (8 a^3 (A-i B)\right ) \text {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=\frac {4 \sqrt {2} a^{5/2} (A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {2 a^2 (A-2 i B) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {2 i a B (a+i a \tan (c+d x))^{3/2}}{3 d}-\frac {\left (2 i a^2 A\right ) \text {Subst}\left (\int \frac {1}{i-\frac {i x^2}{a}} \, dx,x,\sqrt {a+i a \tan (c+d x)}\right )}{d}\\ &=-\frac {2 a^{5/2} A \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {a}}\right )}{d}+\frac {4 \sqrt {2} a^{5/2} (A-i B) \tanh ^{-1}\left (\frac {\sqrt {a+i a \tan (c+d x)}}{\sqrt {2} \sqrt {a}}\right )}{d}-\frac {2 a^2 (A-2 i B) \sqrt {a+i a \tan (c+d x)}}{d}+\frac {2 i a B (a+i a \tan (c+d x))^{3/2}}{3 d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Both result and optimal contain complex but leaf count is larger than twice
the leaf count of optimal. \(429\) vs. \(2(147)=294\).
time = 8.01, size = 429, normalized size = 2.92 \begin {gather*} \frac {e^{-2 i c} \sqrt {e^{i d x}} \left (8 (A-i B) \sinh ^{-1}\left (e^{i (c+d x)}\right )+\sqrt {2} A \left (\log \left (1-e^{i (c+d x)}\right )-\log \left (1+e^{i (c+d x)}\right )+\log \left (1-e^{i (c+d x)}+\sqrt {2} \sqrt {1+e^{2 i (c+d x)}}\right )-\log \left (1+e^{i (c+d x)}+\sqrt {2} \sqrt {1+e^{2 i (c+d x)}}\right )\right )\right ) (a+i a \tan (c+d x))^{5/2} (A+B \tan (c+d x))}{\sqrt {2} d \sqrt {\frac {e^{i (c+d x)}}{1+e^{2 i (c+d x)}}} \sqrt {1+e^{2 i (c+d x)}} \sec ^{\frac {7}{2}}(c+d x) (\cos (d x)+i \sin (d x))^{5/2} (A \cos (c+d x)+B \sin (c+d x))}+\frac {\cos ^3(c+d x) \left ((3 A-8 i B) \left (-\frac {2}{3} \cos (2 c)+\frac {2}{3} i \sin (2 c)\right )+\sec (c+d x) \left (-\frac {2}{3} i B \cos (3 c+d x)-\frac {2}{3} B \sin (3 c+d x)\right )\right ) (a+i a \tan (c+d x))^{5/2} (A+B \tan (c+d x))}{d (\cos (d x)+i \sin (d x))^2 (A \cos (c+d x)+B \sin (c+d x))} \end {gather*}
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 964 vs. \(2 (119 ) = 238\).
time = 0.55, size = 965, normalized size = 6.56
method | result | size |
default | \(\text {Expression too large to display}\) | \(965\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.52, size = 154, normalized size = 1.05 \begin {gather*} -\frac {6 \, \sqrt {2} {\left (A - i \, B\right )} a^{\frac {5}{2}} \log \left (-\frac {\sqrt {2} \sqrt {a} - \sqrt {i \, a \tan \left (d x + c\right ) + a}}{\sqrt {2} \sqrt {a} + \sqrt {i \, a \tan \left (d x + c\right ) + a}}\right ) - 3 \, A a^{\frac {5}{2}} \log \left (\frac {\sqrt {i \, a \tan \left (d x + c\right ) + a} - \sqrt {a}}{\sqrt {i \, a \tan \left (d x + c\right ) + a} + \sqrt {a}}\right ) - 2 i \, {\left (i \, a \tan \left (d x + c\right ) + a\right )}^{\frac {3}{2}} B a + 6 \, \sqrt {i \, a \tan \left (d x + c\right ) + a} {\left (A - 2 i \, B\right )} a^{2}}{3 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 610 vs. \(2 (112) = 224\).
time = 2.78, size = 610, normalized size = 4.15 \begin {gather*} \frac {12 \, \sqrt {2} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a^{5}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {4 \, {\left ({\left (-i \, A - B\right )} a^{3} e^{\left (i \, d x + i \, c\right )} - \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a^{5}}{d^{2}}} {\left (i \, d e^{\left (2 i \, d x + 2 i \, c\right )} + i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{{\left (-i \, A - B\right )} a^{2}}\right ) - 12 \, \sqrt {2} \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a^{5}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {4 \, {\left ({\left (-i \, A - B\right )} a^{3} e^{\left (i \, d x + i \, c\right )} - \sqrt {\frac {{\left (A^{2} - 2 i \, A B - B^{2}\right )} a^{5}}{d^{2}}} {\left (-i \, d e^{\left (2 i \, d x + 2 i \, c\right )} - i \, d\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-i \, d x - i \, c\right )}}{{\left (-i \, A - B\right )} a^{2}}\right ) - 3 \, \sqrt {\frac {A^{2} a^{5}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {16 \, {\left (3 \, A a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + A a^{3} + 2 \, \sqrt {2} \sqrt {\frac {A^{2} a^{5}}{d^{2}}} {\left (d e^{\left (3 i \, d x + 3 i \, c\right )} + d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{A a}\right ) + 3 \, \sqrt {\frac {A^{2} a^{5}}{d^{2}}} {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )} \log \left (\frac {16 \, {\left (3 \, A a^{3} e^{\left (2 i \, d x + 2 i \, c\right )} + A a^{3} - 2 \, \sqrt {2} \sqrt {\frac {A^{2} a^{5}}{d^{2}}} {\left (d e^{\left (3 i \, d x + 3 i \, c\right )} + d e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}\right )} e^{\left (-2 i \, d x - 2 i \, c\right )}}{A a}\right ) - 4 \, \sqrt {2} {\left ({\left (3 \, A - 8 i \, B\right )} a^{2} e^{\left (3 i \, d x + 3 i \, c\right )} + 3 \, {\left (A - 2 i \, B\right )} a^{2} e^{\left (i \, d x + i \, c\right )}\right )} \sqrt {\frac {a}{e^{\left (2 i \, d x + 2 i \, c\right )} + 1}}}{6 \, {\left (d e^{\left (2 i \, d x + 2 i \, c\right )} + d\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 6.97, size = 597, normalized size = 4.06 \begin {gather*} -\left (\frac {2\,a^2\,\left (A+B\,1{}\mathrm {i}\right )}{d}-\frac {B\,a^2\,6{}\mathrm {i}}{d}\right )\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}+\frac {B\,a\,{\left (a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}\right )}^{3/2}\,2{}\mathrm {i}}{3\,d}-\frac {A\,\mathrm {atan}\left (\frac {A^3\,a^8\,d\,\sqrt {a^5}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,224{}\mathrm {i}}{-224\,d\,A^3\,a^{11}+512{}\mathrm {i}\,d\,A^2\,B\,a^{11}+256\,d\,A\,B^2\,a^{11}}-\frac {A\,B^2\,a^8\,d\,\sqrt {a^5}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,256{}\mathrm {i}}{-224\,d\,A^3\,a^{11}+512{}\mathrm {i}\,d\,A^2\,B\,a^{11}+256\,d\,A\,B^2\,a^{11}}+\frac {512\,A^2\,B\,a^8\,d\,\sqrt {a^5}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{-224\,d\,A^3\,a^{11}+512{}\mathrm {i}\,d\,A^2\,B\,a^{11}+256\,d\,A\,B^2\,a^{11}}\right )\,\sqrt {a^5}\,2{}\mathrm {i}}{d}+\frac {\sqrt {2}\,\mathrm {atan}\left (\frac {224\,\sqrt {2}\,A^3\,a^8\,d\,\sqrt {-a^5}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{448\,d\,A^3\,a^{11}-1472{}\mathrm {i}\,d\,A^2\,B\,a^{11}-1536\,d\,A\,B^2\,a^{11}+512{}\mathrm {i}\,d\,B^3\,a^{11}}+\frac {\sqrt {2}\,B^3\,a^8\,d\,\sqrt {-a^5}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,256{}\mathrm {i}}{448\,d\,A^3\,a^{11}-1472{}\mathrm {i}\,d\,A^2\,B\,a^{11}-1536\,d\,A\,B^2\,a^{11}+512{}\mathrm {i}\,d\,B^3\,a^{11}}-\frac {768\,\sqrt {2}\,A\,B^2\,a^8\,d\,\sqrt {-a^5}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}}{448\,d\,A^3\,a^{11}-1472{}\mathrm {i}\,d\,A^2\,B\,a^{11}-1536\,d\,A\,B^2\,a^{11}+512{}\mathrm {i}\,d\,B^3\,a^{11}}-\frac {\sqrt {2}\,A^2\,B\,a^8\,d\,\sqrt {-a^5}\,\sqrt {a+a\,\mathrm {tan}\left (c+d\,x\right )\,1{}\mathrm {i}}\,736{}\mathrm {i}}{448\,d\,A^3\,a^{11}-1472{}\mathrm {i}\,d\,A^2\,B\,a^{11}-1536\,d\,A\,B^2\,a^{11}+512{}\mathrm {i}\,d\,B^3\,a^{11}}\right )\,\left (B+A\,1{}\mathrm {i}\right )\,\sqrt {-a^5}\,4{}\mathrm {i}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________